//
//  TriangleView.swift
//  UserApp_iOS
//
//  Created by BestVast on 2021/5/19.
//  Copyright © 2021 linlin. All rights reserved.
//

import UIKit
let colorTheme = UIColor(red: 239/255, green: 86/255, blue: 21/255, alpha: 1)
let colorThemeBackground = UIColor(red: 239/255, green: 239/255, blue: 239/255, alpha: 1)
/// 商家分类 左侧分类列表，选中状态的三角形view
class TriangleView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
    }
 
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
 
    override func draw(_ rect: CGRect) {
 
        guard let context = UIGraphicsGetCurrentContext() else { return }
 
        context.beginPath()
        context.move(to: CGPoint(x: rect.minX,y: rect.minY))
        context.addLine(to: CGPoint(x: rect.maxX,y: rect.midY))
        context.addLine(to: CGPoint(x: rect.minX,y: rect.maxY))
        context.closePath()
        context.setFillColor(colorTheme.cgColor)
        context.fillPath()
    }

}
